package com.ougy.reshop.model;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.OrderBy;

import com.google.gson.annotations.Expose;

@Entity
public class GoodsClass implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 2072714138400507841L;
	@Expose
	private int id;
	@Expose
	private String className;
	private GoodsClass parent;
	private List<GoodsClass> childs=new ArrayList<GoodsClass>();
	private int sequence;
	@Expose
	private int level;
	private boolean display;
	private boolean recommend;
//	private GoodsType goodsType;
	private String seo_keywords;
	private String seo_description;
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getClassName() {
		return className;
	}
	public void setClassName(String className) {
		this.className = className;
	}
	@OneToMany(mappedBy="parent")
	@OrderBy("sequence asc")
	public List<GoodsClass> getChilds() {
		return childs;
	}
	public void setChilds(List<GoodsClass> childs) {
		this.childs = childs;
	}
	public int getSequence() {
		return sequence;
	}
	public void setSequence(int sequence) {
		this.sequence = sequence;
	}
	public int getLevel() {
		return level;
	}
	public void setLevel(int level) {
		this.level = level;
	}
	public boolean isDisplay() {
		return display;
	}
	public void setDisplay(boolean display) {
		this.display = display;
	}
	public boolean isRecommend() {
		return recommend;
	}
	public void setRecommend(boolean recommend) {
		this.recommend = recommend;
	}
//	@ManyToOne
//	public GoodsType getGoodsType() {
//		return goodsType;
//	}
//	public void setGoodsType(GoodsType goodsType) {
//		this.goodsType = goodsType;
//	}
	@Column(columnDefinition="LongText")
	public String getSeo_keywords() {
		return seo_keywords;
	}
	public void setSeo_keywords(String seo_keywords) {
		this.seo_keywords = seo_keywords;
	}
	@Column(columnDefinition="LongText")
	public String getSeo_description() {
		return seo_description;
	}
	public void setSeo_description(String seo_description) {
		this.seo_description = seo_description;
	}
	@ManyToOne
	public GoodsClass getParent() {
		return parent;
	}
	public void setParent(GoodsClass parent) {
		this.parent = parent;
	}
	
}
